<?php
/*
	获取活动详情
	电商客商品列表页和商品详情页会调用本方法以获得商品详情
*/
defined('BY_JYA') or exit('error');
list($goods_id,$active_id)=$arguments;
$plugininfo=pdo_get('jy_pddke_url',array('goodsid'=>$goods_id,'uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']));
if(!$plugininfo['url']){
		$data=$this->model()->getfeeurl($_SESSION['uid'],$goods_id);
		$this->model()->intfeeurl($data);
		$plugininfo=pdo_get('jy_pddke_url',array('goodsid'=>$goods_id,'uniacid'=>$_SESSION['uniacid']));
}
$goods['active']['url']=$plugininfo['we_app_web_view_url'];
$goods['active']['code']=$plugininfo['code'];
$tk_rate=pdo_getcolumn('jy_pddke_goods',array('goodsid'=>$goods_id,'uniacid'=>$_SESSION['uniacid']),'promotion_rate');
//千分比改成百分比
$tk_rate=$tk_rate/10;
$price=pdo_getcolumn('jy_weishop_goods',array('id'=>$goods_id,'uniacid'=>$_SESSION['uniacid']),'price');
if($this->plugin_exists('jy_weishopke')){
	$set=plugin('jy_weishopke')->plugin_setting('basic');
}
$set['ratio']=$set['ratio']?:'50';
$set['vipratio']=$set['vipratio']?:'90';
$tk_rate=intval($tk_rate)?:5;
$getfee=$tk_rate*$price/100;
$goods['active']['ke_money']=price($getfee*$set['ratio']/100,true);
$goods['active']['keup_money']=price($getfee*$set['vipratio']/100,true);
$goods['active']['ke_title']=$set['ke_title']?:'预估赚';
$goods['active']['typeke']='pdd';
return $goods['active'];